<template>
  <SelectDialog
    ref="dialogRef"
    :title="title"
    :request-api="deptApi.list"
    :columns="columns"
    @submit="handleSubmit"
    row-key="deptId"
    row-name="deptName"
    :pagination="false"
  ></SelectDialog>
</template>

<script setup lang="ts" name="PostSelectDialog">
import { ref, defineEmits } from "vue";
import deptApi from "@/views/system/dept/api";
import SelectDialog from "../SelectDialog/index.vue";
import { ColumnProps } from "@/components/Table/type";
const title = ref("部门选择");
const dialogRef = ref();
const emit = defineEmits(["submit"]);
const handleSubmit = selectedList => {
  emit("submit", selectedList);
};
const columns: ColumnProps[] = [{ prop: "deptName", label: "部门名称", search: { el: "input" } }];
const open = () => {
  dialogRef.value.open();
};
defineExpose({ open });
</script>

<style scoped></style>
